package dcc.component;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JScrollPane;

import com.l2fprod.common.swing.JTaskPane;
import com.l2fprod.common.swing.JTaskPaneGroup;

import dcc.tools.Tools;

public class DataExportTaskPaneGroup extends JTaskPaneGroup {

	private String telentsType;
	private String telentsLabel;

	public DataExportTaskPaneGroup(String typeName, JTaskPane taskPane) {
		super();
		this.telentsType = typeName;
		this.telentsLabel = Tools.get().getValue("TYPE_" + telentsType);
		init(taskPane);
	}

	private void init(JTaskPane taskPane) {
		this.setTitle(telentsLabel);
		taskPane.add(this);
		getContentPane().setLayout(new BorderLayout(0, 0));
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setPreferredSize(new Dimension(2, 180));
		getContentPane().add(scrollPane, BorderLayout.CENTER);
		table = new DataExportTable(this, telentsLabel);
		scrollPane.setViewportView(table);
	}

	private DataExportTable table;

	public void update() {
		table.updateTable();
	}

	public void selectAll() {
		table.selectAllTalents();
	}

	public void unSelectAll() {
		table.unSelectAllTalents();
	}
}
